home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 86
/
(Vol 86) My Disc.iso
/
Games
/
moda_1223.swf
/
scripts
/
DefineSprite_123
/
frame_1
/
DoAction.as
Wrap
Text File
|
2009-04-23
|
2KB
|
57 lines
var flowerName = "sunflower";
var flowerSize = 4;
var flowerDuration = 12;
var animationType = "over";
var leafDuration = flowerDuration / 2;
var msListener = new Object();
var count = 0;
var nameCount = 0;
var drawing = false;
var deleteCount = 0;
msListener.onMouseDown = function()
{
drawing = true;
};
msListener.onMouseMove = function()
{
nameCount += 1;
count++;
if(animationType == "over")
{
drawing = true;
}
if(drawing and count > leafDuration)
{
_parent.flowerBox.attachMovie("leaf1","leaf" + nameCount,getNextHighestDepth(),{_x:_xmouse,_y:_ymouse,_width:18,_height:39});
_parent.flowerBox["leaf" + nameCount]._rotation = random(360);
}
if(drawing and count > flowerDuration)
{
_parent.flowerBox.attachMovie(flowerName,"flower" + nameCount,getNextHighestDepth(),{_x:_xmouse,_y:_ymouse,_width:flowerSize,_height:flowerSize});
_parent.flowerBox["flower" + nameCount]._rotation = random(360);
}
if(count > flowerDuration)
{
count = 0;
}
};
msListener.onMouseUp = function()
{
drawing = false;
};
var deleteControl = this.createEmptyMovieClip("deleteControl",this.getNextHighestDepth());
deleteControl.onEnterFrame = function()
{
if(deleteCount < nameCount)
{
deleteCount++;
}
else
{
deleteCount = nameCount;
}
_parent.flowerBox["leaf" + deleteCount].gotoAndPlay("out");
_parent.flowerBox["flower" + deleteCount].gotoAndPlay("out");
};
Mouse.addListener(msListener);